#include<stdio.h>

int main()
{
	int n = 0;
	int i = 0;
	int j = 0;
	int re = 0;
	int sum = 0;
	scanf_s("%d", &n);
	for (i = 1; i <= n; i++)
	{
		sum = 1;
		for (j = 1; j <= i; j++)
		{
			sum *= j;
		}
		re += sum;
	}
	printf("%d", re);
	return 0;
	}
